package com.mycompany.myapp.service;

import com.mycompany.myapp.domain.Commodity;
import com.mycompany.myapp.service.dto.CommodityDTO;
import com.mycompany.myapp.web.rest.utils.ResultObj;

import java.util.List;
import java.util.Optional;

/**
 * Service Interface for managing {@link com.mycompany.myapp.domain.Commodity}.
 */
public interface CommodityService {

    /**
     * Save a commodity.
     *
     * @param commodityDTO the entity to save.
     * @return the persisted entity.
     */
    CommodityDTO save(CommodityDTO commodityDTO);

    /**
     * Get all the commodities.
     *
     * @return the list of entities.
     */
    List<CommodityDTO> findAll();


    /**
     * Get the "id" commodity.
     *
     * @param id the id of the entity.
     * @return the entity.
     */
    Optional<CommodityDTO> findOne(Long id);

    /**
     * Delete the "id" commodity.
     *
     * @param id the id of the entity.
     */
    void delete(Long id);

    ResultObj insertCommodity(CommodityDTO commodityDTO);

    List<CommodityDTO> getCommodityByFashionAndQuality();

    List<CommodityDTO> getTheLatestCommodity();

    Commodity findCommodityById(Long id);

    List<Commodity> findCommodityByType(String type);

    ResultObj updateCommodity(CommodityDTO commodityDTO);

    Commodity findCommodityByName(String name);

    ResultObj findGoodsByParams(int pageNum, int pageSize, String cname);

    ResultObj deleteGoodsInfo(long id);
}
